by Shyue Ping Ong
This notebook demonstrates the computation of orbits in the mmm point group. It is part of course material for UCSD's NANO106 - Crystallography of Materials. Unlike the $m\overline{3}m (O_h)$ version, this duplicates relevant code from the symmetry package to explicitly demonstrate the priniciples of generating point group symmetry operations.
In [1]:
import numpy as np
import itertools
from sympy import symbols
We will now define a useful function for checking existence of np.arrays in a list of arrays. It is not the most efficient implementation, but would suffice for our purposes.
In [2]:
def in_array_list(array_list, a):
for i in array_list:
if np.all(np.equal(a, i)):
return True
return False
In [3]:
generators = []
for i in xrange(3):
g = np.eye(3).astype(np.int)
g[i, i] = -1
generators.append(g)
We will now generate all the group symmetry operation matrices from the generators.
In [4]:
symm_ops = []
symm_ops.extend(generators)
new_ops = generators
while len(new_ops) > 0:
gen_ops = []
for g1, g2 in itertools.product(new_ops, symm_ops):
#Note that we cast the op to int to improve presentation of the results.
#This is fine in crystallographic reference frame.
op = np.dot(g1, g2)
if not in_array_list(symm_ops, op):
gen_ops.append(op)
symm_ops.append(op)
op = np.dot(g2, g1)
if not in_array_list(symm_ops, op):
gen_ops.append(op)
symm_ops.append(op)
new_ops = gen_ops
print "The order of the group is %d. The group matrices are:" % len(symm_ops)
for op in symm_ops:
print op
In [5]:
x, y, z = symbols("x y z")
def get_orbit(symm_ops, p):
"""Given a set of symmops and a point p, this function returns the orbit"""
orbit = []
for o in symm_ops:
pp = np.dot(o, p)
if not in_array_list(orbit, pp):
orbit.append(pp)
return orbit
In [6]:
p = np.array([x, y, z])
print "For the general position %s, the orbit is " % str(p)
for o in get_orbit(symm_ops, p):
print o,
In [7]:
p = np.array([0, 0, z])
orb = get_orbit(symm_ops, p)
print "For the special position %s on the two-fold axis, the orbit comprise %d points:" % (str(p), len(orb))
for o in orb:
print o,
The orbit is similar for the other two-fold axes on the a and b axes are similar.
In [8]:
p = np.array([x, y, 0])
orb = get_orbit(symm_ops, p)
print "For the special position %s on the two-fold axis, the orbit comprise %d points:" % (str(p), len(orb))
for o in orb:
print o,
The orbit is similar for the other two mirror planes on the a-c and b-c planes are similar.